﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BallData
{
    public class Bet007_Match
    {
         
        public String mId;
        public String lId;
        public String time;
        public String t1Id;
        public String t1CnName;
        public String t1TrName;
        public String t1EnName;
        public String t1Position;
        public String t2Id;
        public String t2CnName;
        public String t2TrName;
        public String t2EnName;
        public String t2Position;
        public String state;
        public String homeScore;
        public String guestScore;
        public String tv;
        public String flag;
    
        public String level;
        public String h_redcard;
        public String g_redcard;
        public String h_yellow;
        public String g_yellow;

        public String H_redcard;
        public String G_redcard;
        public String H_yellow;
        public String G_yellow;
        public String matchCenter;
        public String getT1Name(String lang) 
        {
            if (lang == "2")
                return this.t1EnName;
            else if (lang == "1")
                return this.t1TrName;
            else
                return this.t1CnName;
        }

        public String getT2Name(String lang)
        {
            if (lang == "2")
                return this.t2EnName;
            else if (lang == "1")
                return this.t2TrName;
            else
                return this.t2CnName;
        }
        public Bet007_Match(String infoStr)
        {
                String[] infoArr = infoStr.Split(OddsUntil.Bet007_SplitColumn); //265454,539,2009-5-6 23:00:00,,6734,学生体育,學生體育,Sportul Studentesc,14,6730,德尔塔,德爾塔,Delta Tulcea,2,0,0,0,,False;
                this.mId = infoArr[0];
                this.lId = infoArr[1];
                //	this.time = new Date(parseInt(infoArr[2]));
                //this.time = AmountTimeDiff(infoArr[2]);
                //var d = AmountTimeDiff(infoArr[2]);
                //d.setTime(d.getTime() - 8 * 3600 * 1000); //方便当天4点后的显示到前一天的页面
                //var strD = _oddsUitl.getOnlyDate(d);
                //if (selDate == "") selDate = _oddsUitl.getDate(strD);
                //if (strDataList.indexOf(strD) == -1)
                //strDataList += strD + ",";
                //    if (infoArr[3] != "") this.time2 = new Date(parseInt(infoArr[3]));
                //if (infoArr[3] != "") this.time2 = AmountTimeDiff(infoArr[3]);
                this.t1Id = infoArr[4];
                this.t1CnName = infoArr[5];
                this.t1TrName = infoArr[6];
                this.t1EnName = infoArr[7];
                this.t1Position = infoArr[8] != "" ? "[" + infoArr[8] + "]" : "";
                this.t2Id = infoArr[9];
                this.t2CnName = infoArr[10];
                this.t2TrName = infoArr[11];
                this.t2EnName = infoArr[12];
                this.t2Position = infoArr[13] != "" ? "[" + infoArr[13] + "]" : "";
                this.state = infoArr[14];
                this.homeScore = infoArr[15];
                this.guestScore = infoArr[16];
                this.tv = infoArr[17];
                this.flag = "";
                if (infoArr[18] == "True") this.flag = "(中)";
                this.level = infoArr[19];

                if (infoArr.Length > 20)
                {

                    this.h_redcard = infoArr[20];
                    this.g_redcard = infoArr[21];
                    this.h_yellow = infoArr[22];
                    this.g_yellow = infoArr[23];
                    if (infoArr[20] != "0") this.H_redcard = "<img src='images/redcard" + infoArr[20] + ".gif'>"; else this.H_redcard = "";
                    if (infoArr[21] != "0") this.G_redcard = "<img src='images/redcard" + infoArr[21] + ".gif'>"; else this.G_redcard = "";
                    if (infoArr[22] != "0") this.H_yellow = "<img src='images/yellow" + infoArr[22] + ".gif'>"; else this.H_yellow = "";
                    if (infoArr[23] != "0") this.G_yellow = "<img src='images/yellow" + infoArr[23] + ".gif'>"; else this.G_yellow = "";
                    this.matchCenter = infoArr[24];
                }
   
        }
    }
}
